<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>结算记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<link href="../admin/easyui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../script/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../script/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
$(function(){
    $('#settlement_records').treegrid({
        fitColumns:true,
        idField:"id",
        treeField:"name",
        url:'<{$config.weburl}>/admin/module.php?m=product&s=settlement_records.php&act=ajax_get_records&member_id=<{$smarty.get.member_id}>&time_str=<{$smarty.get.time_str}>',
        columns:[[
                    {title:'ID',field:'id',width:180,hidden:true},
                    {title:'用户ID',field:'member_id',width:100},
                    {title:'会员名称',field:'name',width:250},
                    {title:'销售额',field:'self_sales',width:180},
                    {title:'返利金额',field:'self_back_price',width:180},
                    {title:'团队销售额',field:'group_sales',width:180},
                    {title:'团队返利金额',field:'group_back_price',width:180},
                    {title:'月份',field:'formart_time',width:180},
                    {title:'状态',field:'status_str',width:180}
                ]],
   });
});
</script>
</head>
<body>
<div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>结算记录</h3>
                <ul>
                    <{if $isShowImproveButton }><li><a href="module.php?m=product&s=settlement_records.php&act=preparation_for_settlement">完善上月合伙人数据&nbsp;&nbsp;&nbsp;</a></li><{/if}>
                    <li><a href="module.php?m=product&s=settlement_records.php&act=settle_last_month">结算上月返利</a></li>
                </ul>
            </div>
        </div>
        
        <div class="h35"></div>
        
        <form action="" method="get">
        <input type="hidden" name="m" value="product">
        <input type="hidden" name="s" value="settlement_records.php">
        <table class="select_table">
            <tbody>
                <tr>
                    <td width="60">用户ID:</td>
                    <td width="100"><input id="member_id" type="text" name="member_id" class="w100" value="<{$smarty.get.member_id}>" /></td>
                    <{if 0 }>
                    <td width="60">用户类型:</td>
                    <td width="100">
                        <select name="member_type">
                            <option value="">全部</option>
                            <option value="1" <{if $smarty.get.member_type=='1'}>selected<{/if}>>合伙人</option>
                            <option value="2" <{if $smarty.get.member_type=='2'}>selected<{/if}>>普通用户</option>
                        </select>
                    </td>
                    <{/if}>
                    <td width="100">时间(月份):</td>
                    <td width="100">
                        <select class="easyui-combobox" name="time_str" id="time_str" style="width:100px;" data-options="valueField: 'time_str',textField: 'time_str'" url="/admin/module.php?m=product&s=settlement_records.php&act=getTimeStrList">
                            <{if $smarty.get.time_str}>
                                <option value="<{$smarty.get.time_str}>"><{$smarty.get.time_str}></option>
                            <{/if}>
                        </select>
                    </td>
                    <td><input id="search" type="image" src="<{$config.weburl}>/image/admin/search.gif" /></td>
                </tr>
            </tbody>
        </table>
        </form>
    <{if $smarty.get.member_type=='1'}>
        <table id="settlement_records" class="easyui-treegrid" style="width:100%">
        </table>
    <{else}>
    <table class="table product">
       <tbody>
       <tr class="header">
            <th>会员ID</th>
            <th>会员名称</th>
            <th>销售额</th>
            <th>返利金额</th>
            <{if 0 }>
            <th>团队销售额</th>
            <th>团队返利金额</th>
            <{/if}>
            <th>月份</th>
            <th>状态</th>
        </tr>
        <{foreach item=list from=$de.list}>
        <tr>
            <td><{$list.member_id}></td>
            <td><{$list.name}></td>
            <td><{$list.self_sales}></td>
            <td><{$list.self_back_price}></td>
            <{if 0 }>
            <td><{$list.group_sales}></td>
            <td><{$list.group_back_price}></td>
            <{/if}>
            <td><{$list.formart_time}></td>
            <td><{ if $list.status }>已结算<{else}>未结算<{/if}></td>
        </tr>
        <{foreachelse}>
        <tr>
            <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
        </tr>
        <{/foreach}>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="99">
                    <div class="fl">每页最多显示： 20条</div>
                    <div class="page"><{$de.page}></div>
                    <div class="fr">共有<{$de.count}>条记录</div>
                </td>
            </tr>
        </tfoot>
    </table>
    <{/if}>
</div>
</body>
</html>